// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   kindCounter.java

package include.nseer_cookie;

import include.nseer_db.nseer_db;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import uk.ltd.getahead.dwr.WebContext;
import uk.ltd.getahead.dwr.WebContextFactory;

public class kindCounter
{

	WebContext ctx;
	HttpServletRequest request;
	HttpSession session;
	nseer_db hr_db;

	public kindCounter()
	{
		ctx = WebContextFactory.get();
		request = ctx.getHttpServletRequest();
		session = request.getSession();
		hr_db = new nseer_db((String)session.getAttribute("unit_db_name"));
	}

	public void setDesignCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('designcount_")).append(kind).append("','100001','designcount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setPurchaseCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('purchasecount_")).append(kind).append("','100001','purchasecount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setIntrmanufactureCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('intrmanufacturecount_")).append(kind).append("','100001','intrmanufacturecount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setLogisticsCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('logisticscount_")).append(kind).append("','100001','logisticscount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setHrCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('hrcount_")).append(kind).append("','100001','hrcount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setCrmCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('crmcount_")).append(kind).append("','100001','crmcount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setEcommerceNewsCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('ecommercenewscount_")).append(kind).append("','100001','ecommercenewscount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public void setEcommerceOtherCounter(String kind)
	{
		try
		{
			String sql = (new StringBuilder("insert into security_counter(kind,count_value,kind_name) values('ecommerceothercount_")).append(kind).append("','100001','ecommerceothercount')").toString();
			hr_db.executeUpdate(sql);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
